<!DOCTYPE html>
<html>
<head>
<title>管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" type="text/css"
	href="/codebase/fonts/font_roboto/roboto.css" />
<link rel="stylesheet" type="text/css" href="/codebase/dhtmlx.css" />
<script type="text/javascript" src="/codebase/dhtmlx.js"></script>
<style>

/* important for proper init */
html, body {
	width: 100%;
	height: 100%;
	margin: 0px;
	overflow: hidden;
/* 	background-color: #fcfff5; */
}

div#layoutObj {
	position: relative;
	margin-top: 1px;
	margin-left: 1px;
	width: 100%;
	height: 100%;
}

/* header */
div.my_header {
	padding-bottom: 1px;
		width: 100%;
}

div.my_header div.text_block {
	height: 50px;
	line-height: 44px;
	font-size: 28px;
	color: #199BC6;
	
	margin-left: 5px;
	padding-left: 200px;
	background-image: url("/common/szsrcb-logo.png");
	background-repeat: no-repeat;
	background-position: center left;
}


/* footer */
div.my_footer {
	padding-top: 4px;
}

div.my_footer div.text_block {
	padding: 5px 10px;
	height: 21px;
	line-height: 21px;
	text-align: center;
}

div.text_block {
	padding: 5px 10px;
	font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans",
		Geneva, Verdana, sans-serif;
	font-size: 12px;
	color: #333;
}

div.text_block a {
	font: inherit;
	color: inherit;
	margin: 0px 4px;
	text-decoration: none !important;
	border-bottom: 1px dotted #555;
}
/* attached */
h3.some_header {
	padding-left: 10px;
	padding-right: 10px;
	font-family: Roboto, Arial, Helvetica;
	color: #404040;
}

div.some_text {
	padding-left: 10px;
	padding-right: 10px;
	font-size: 14px;
	font-family: Roboto, Arial, Helvetica;
	color: #404040;
}
</style>
<script>
	var myLayout;
	var myMenu;
	var myToolbar;

	function doOnLoad() {

		myLayout = new dhtmlXLayoutObject({
			parent : "layoutObj",
			pattern : "1C"
		});
		var g_user_role=document.getElementById("user_role").innerHTML;
		var menu_xml=""
		
		if(g_user_role=="admin"){
				menu_xml="/common/testmanager/dhxmenu_leader.xml";
		}
		if(g_user_role=="部门主管领导"){
			menu_xml="/common/testmanager/dhxmenu_leader.xml";
		}
		if(g_user_role=="项目管理中心负责人"){
			menu_xml="/common/testmanager/dhxmenu_leader.xml";
		}
		if(g_user_role=="业务方案中心负责人"){
			menu_xml="/common/testmanager/dhxmenu_leader.xml";
		}
		
		if(g_user_role=="普通用户"){
			menu_xml="/common/testmanager/dhxmenu_staffer.xml";	
		}
		
		if(g_user_role=="需求录入用户"){
			menu_xml="/common/testmanager/dhxmenu_req_input.xml";	
		}
		
		if(g_user_role=="开发中心测试申请录入"){
			menu_xml="/common/testmanager/dhxmenu_test_input.xml";	
		}
		/* if(is_leader=="true"){
			
		}else{
			var is_req_input=document.getElementById("is_req_input").innerHTML;
			if(is_req_input=="true"){
				menu_xml="/common/testmanager/dhxmenu_req_input.xml";
			}else{
				menu_xml="/common/testmanager/dhxmenu_staffer.xml";	
			}
			
		} */
		myMenu = myLayout.attachMenu({
			parent : document.body,
			icons_path : "/common/imgs/",
			//xml : "/common/testmanager/dhxmenu.xml"
			xml : menu_xml

		});
		
		//myLayout.setSkin("dhx_web");
		
		myLayout.cells("a").hideHeader();

		//myLayout.hideMenu();
		myLayout.attachHeader("my_logo");
		myLayout.attachFooter("my_copy");
		myLayout.attachEvent("onContentLoaded", function(id) {
			//var ifr = myLayout.cells("a").getFrame();
			doOnLoad();
		});
		
		myMenu.attachEvent("onClick", function(id, zoneId, cas) {
			myLayout.cells("a").detachObject();
			//myLayout.cells("a").detachObject(true);
			if (id == "req_new") {
				
			
				myLayout.cells("a").attachURL("/req/req_new", true);
				//myLayout.cells("a").attachURL("/req/req_new");
			}
			if (id == "req_assign") {
				
			
				myLayout.cells("a").attachURL("/req_assign", true);
			}
						
			if (id == "req_mgmt") {
			
				myLayout.cells("a").attachURL("/req_mgmt", true);
				//myLayout.cells("a").attachURL("/req_modify_detail", true);
				
			}	
			
			if (id == "req_trace") {
			
				//myLayout.cells("a").attachURL("/req_trace", true);
				window.location.href = '/ExcelGenerator_req_projec_trace';
			}	
			
			if (id == "test_trace") {
				
				//myLayout.cells("a").attachURL("/test_trace", true);
				window.location.href = '/ExcelGenerator_test_projec_trace';
			}	
			
			
			if (id == "req_my") {
			
				myLayout.cells("a").attachURL("/req_my", true);
			}
			
			if (id == "test_my") {
				
				myLayout.cells("a").attachURL("/test_my", true);
			}	
			
			if (id == "test_new") {
			
				myLayout.cells("a").attachURL("/test/test_new", true);
			}	
			
			if (id == "test_assign") {
			
				myLayout.cells("a").attachURL("/test/test_assign", true);
				//myLayout.cells("a").attachURL("/test/test_assign_list", true);				
			}	
			
			
			if (id == "test_mgmt") {
			
				myLayout.cells("a").attachURL("/test/test_mgmt", true);
			}
			
			if (id == "test_project_trace") {
				
				myLayout.cells("a").attachURL("/req_trace", true);
				//window.location.href = '/ExcelGenerator_req_projec_trace';
			}
			
			if (id == "test_info_collect") {
			
				myLayout.cells("a").attachURL("/test_info_collect", true);
			}
			
			if (id == "query_req") {
// 				myLayout.attachEvent("onContentLoaded", function(id) {
// 					var ifr = myLayout.cells("a").getFrame();
// 					doOnLoad();
// 				});
				myLayout.cells("a").attachURL("/query_req", true);
			}
			
			if (id == "query_test") {
			
				myLayout.cells("a").attachURL("/query_test", true);
			}
			if (id == "query_staffer") {
			
				myLayout.cells("a").attachURL("/query_staffer", true);
			}		
			if (id == "change_pwd") {
				
				myLayout.cells("a").attachURL("/change_pwd", true);
			}
			
			if (id == "person_info") {
				
				myLayout.cells("a").attachURL("/person_info", true);
			}	
			
			

		});
	}
</script>
</head>
<body onload="doOnLoad();">
	<div id="is_leader" name="is_leader" th:text="${is_leader}" style="display: none;" > </div>
	<div id="user_role" name="user_role" th:text="${user_role}" style="display: none;"></div>
	<div id="is_req_input" name="is_req_input" th:text="${is_req_input}" style="display: none;"></div>
	<!-- header -->
	<div id="my_logo" class="my_header">
		
		<table style="width: 100%;">
			<tr><td><div class="text_block">管理系统</div></td>
				
				<td><div class="text_user_name" id="user_name" name="user_name" th:text="${user_name}" align="right"></div></td>
				<!-- <td><div class="text_user_role" id="user_role" name="user_role" th:text="${user_role}" align="right"></div></td> -->
				<td><a href="/logout">退出</a></td>
			</tr>
		</table>
	</div>

	<div id="layoutObj"></div>
	<div id="form_container" style="width: 100%, height:100%"></div>
<table>
		<tr>
			<td>
				<div id="test2"></div>
			</td>
		</tr>
		<tr>
			<td>
				<div id="test1"></div>
			</td>
		</tr>
	</table>
	<!-- footer -->
	<div id="my_copy" class="my_footer">
		<div class="text_block">&copy; 2016 深圳农村商业银行</div>
	</div>

</body>
</html>